﻿<UserControl x:Class="MVVMDemo.View.DetailView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Height="Auto" Width="Auto">
    <Grid DataContext="{Binding SelectedPerson}">
        <!--Định nghĩa 5 dòng vs 2 cột với kích thước tự động-->
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        
        <!--Định nghĩa nhãn cho cột đầu tiên-->
        <Label Grid.Column="0" Grid.Row="0" Content="Age"/>
        <Label Grid.Column="0" Grid.Row="1" Content="First Name"/>
        <Label Grid.Column="0" Grid.Row="2" Content="Last Name"/>
        <Label Grid.Column="0" Grid.Row="3" Content="Is Male"/>
        <Label Grid.Column="0" Grid.Row="4" Content="Is Female"/>
        
        <!--định nghĩa các thành phần cột thứ 2 gồm có 3 textbox và 2 checkbok-->
        <TextBox Grid.Column="1" Grid.Row="0" Width="25"
                 Text="{Binding Path=Age, Mode=TwoWay}"
                 HorizontalAlignment="Left" VerticalAlignment="Top"/>
        <TextBox Grid.Column="1" Grid.Row="1" Width="100"
                 Text="{Binding Path=FirstName, Mode=TwoWay}"
                 HorizontalAlignment="Left" VerticalAlignment="Top"/>
        <TextBox Grid.Column="1" Grid.Row="2" Width="100"
                 Text="{Binding Path=LastName, Mode=TwoWay}"
                 HorizontalAlignment="Left" VerticalAlignment="Top"/>
        
        <CheckBox Grid.Column="1" Grid.Row="3" Content=""
                  IsChecked="{Binding Path=IsMale, Mode=TwoWay}"/>
        <CheckBox Grid.Column="1" Grid.Row="4" Content=""
                  IsChecked="{Binding Path=IsFemale, Mode=TwoWay}"/>
        
    </Grid>
</UserControl>
